import React from 'react';
import { Menu, Icon } from 'antd';
import{ Link,withRouter }from'dva/router'

class Header extends React.Component{
//function Header({ location }) {
    render(){
        const { location } = this.props;
        return (
            <Menu selectedKeys={[location.pathname]} mode="horizontal" theme="dark">
              <Menu.Item key="/">
                <Link to="/">
                  <Icon type="home" />Home
                </Link>
              </Menu.Item>
              <Menu.Item key="/stockrequire">
                <Link to="/stockrequire">
                  <Icon type="bars" />库存申请
                </Link>
              </Menu.Item>
              <Menu.Item key="/repos">
                <a href="https://gitee.com/zhangbin_org">我的代码仓库</a>
              </Menu.Item>
            </Menu>
          )
    }
}

export default withRouter(Header);